package Communication;

import LiftEngine.Lift;
import java.io.Serializable;
import java.util.LinkedList;

/**
 *
 * Class description goes here.
 *
 * @author Kamil Gajowy
 */
public class M2ServerPacket implements Serializable {

    private int moduleType;
    private int liftDirection;
    private int liftFloor;
    private int ID;
    private LinkedList<TaskForServer> taskList;
    private int lastTaskID = -1;

    public int getID() {
        return ID;
    }

    public void setID(int ID) {
        this.ID = ID;
    }

    /**
    * Default constructor.
     * @param myType 
     */
    public M2ServerPacket(int myType, int id, LinkedList<TaskForServer> list ){
        this.moduleType = myType;
        this.ID = id;
        this.taskList = list;
    }

    /**
     * @return the moduleType
     */
    public int getModuleType() {
        return moduleType;
    }

    /**
     * @return the liftDirection
     */
    public int getLiftDirection() {
        return liftDirection;
    }

    /**
     * @param liftDirection the liftDirection to set
     */
    public void setLiftDirection(int liftDirection) {
        this.liftDirection = liftDirection;
    }

    /**
     * @return the liftFloor
     */
    public int getLiftFloor() {
        return liftFloor;
    }

    /**
     * @param liftFloor the liftFloor to set
     */
    public void setLiftFloor(int liftFloor) {
        this.liftFloor = liftFloor;
    }

    /**
     * @return the taskList
     */
    public LinkedList<TaskForServer> getTaskList() {
        return taskList;
    }

    /**
     * @param taskList the taskList to set
     */
    public void setTaskList(LinkedList<TaskForServer> taskList) {
        this.taskList = taskList;
    }

    public void addTask(TaskForServer task){
        this.taskList.add(task);
    }

    public void setLastTaskID(int i){
        this.lastTaskID = i;
    }

    public int getLastTaskID(){
        return this.lastTaskID;
    }

}//end class
